package com.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the returneds database table.
 * 
 */
@Entity
@Table(name="returneds")
@NamedQuery(name="Returned.findAll", query="SELECT r FROM Returned r")
public class Returned implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String returnid;

	private BigDecimal returnalready;

	private BigDecimal returnshould;

	private String returnstate;

	//bi-directional many-to-one association to Returndetail
	@OneToMany(mappedBy="returned")
	private List<Returndetail> returndetails;

	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="cid")
	private Customer customer;

	//bi-directional many-to-one association to Order
	@ManyToOne
	@JoinColumn(name="orderid")
	private Order order;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="staffid")
	private Staff staff;

	public Returned() {
	}

	public String getReturnid() {
		return this.returnid;
	}

	public void setReturnid(String returnid) {
		this.returnid = returnid;
	}

	public BigDecimal getReturnalready() {
		return this.returnalready;
	}

	public void setReturnalready(BigDecimal returnalready) {
		this.returnalready = returnalready;
	}

	public BigDecimal getReturnshould() {
		return this.returnshould;
	}

	public void setReturnshould(BigDecimal returnshould) {
		this.returnshould = returnshould;
	}

	public String getReturnstate() {
		return this.returnstate;
	}

	public void setReturnstate(String returnstate) {
		this.returnstate = returnstate;
	}

	public List<Returndetail> getReturndetails() {
		return this.returndetails;
	}

	public void setReturndetails(List<Returndetail> returndetails) {
		this.returndetails = returndetails;
	}

	public Returndetail addReturndetail(Returndetail returndetail) {
		getReturndetails().add(returndetail);
		returndetail.setReturned(this);

		return returndetail;
	}

	public Returndetail removeReturndetail(Returndetail returndetail) {
		getReturndetails().remove(returndetail);
		returndetail.setReturned(null);

		return returndetail;
	}

	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Order getOrder() {
		return this.order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

}